﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;

namespace RemoteTestRunner.FormsUI.Wpf
{
    public class BooleanToHiddenVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Visibility result = Visibility.Visible;
            try
            {
                bool boolValue = (bool)value;
                if (boolValue)
                {
                    result = Visibility.Visible;
                }
                else
                {
                    //result = Visibility.Hidden;
                    result = Visibility.Collapsed;
                }
            }
            catch (Exception)
            {
            }
            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value;
        }

    }
}
